<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use think\Db;
class Index extends Controller
{
    public function index($name='张三')
    {
		header('Access-Control-Allow-Origin: *');  //I have also tried the * wildcard and get the same response
		header('Access-Control-Allow-Headers: Content-Type');
		
		$data=Db::name('user')->where('id',1)->find();
		//$data=['username'=>$name,'state'=>'111'];
        // print_r($data);
        //echo $data;
        echo json_encode(apache_request_headers());
   }
}
